package com.hjx.service.impl;

import com.hjx.entity.SysApply;
import com.hjx.mapper.SysApplyMapper;
import com.hjx.service.SysApplyService;
import com.hjx.util.UUIDUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>Title:</p>
 * <p>Description:</p>
 *
 * @author hjx
 * @date 2020/6/10 - 16:46
 */
@Service
@Transactional
public class SysApplyServiceImpl implements SysApplyService {
    @Resource
    SysApplyMapper sysApplyMapper;
    @Override
    public List<SysApply> findAll() {
        return sysApplyMapper.findAll();
    }

    @Override
    public List<SysApply> findBy(SysApply sysApply) {
        return sysApplyMapper.findBy(sysApply);
    }

    @Override
    public boolean insert(SysApply sysApply) {
        sysApply.setAid(UUIDUtil.getUUID());
        return sysApplyMapper.insert(sysApply);
    }

    @Override
    public boolean delete(String aid) {
        return sysApplyMapper.delete(aid);
    }

    @Override
    public boolean updateStatus(Map<String,Object> map) {
        if (map!=null){
            return sysApplyMapper.updateStatus(map);
        }
        return false;
    }
}
